home *** CD-ROM | disk | FTP | other *** search
-
- M A P V I E W 2.0
-
- Gisbert W. Selke, 11 Jan 1989
-
-
- MapView is an interactive programme for drawing maps in a variety of
- projections. It reads data from files in a number of formats and
- displays them on all display adapters supported by TurboPascal 5.0,
- the language it was written in. It should run on all IBM PCs and
- clones on which TurboPascal's Graph unit runs. As distributed, it
- makes no use of a coprocessor, but it can easily be recompiled to do
- so. It makes nearly no sense to use this programme without a hard
- disk. A hardcopy facility is built in which is designed for Epson
- type dot matrix printers. Also supplied are two programmes to
- preprocess data (Mp1ToMpx, TrigCalc) and two to view previously
- generated pictures (Slide/QSlide). Full sources to all the programmes
- are supplied. - Map data files have to be acquired independently;
- MapView has no built-in data whatsoever. The map files it was
- designed to work with have been produced by John Allison and can
- probably gotten at the same place (bulletin board etc.) as MapView.
-
-
- (i) Quick start
- ---------------
-
- This tells you how to get started as fast as possible. All the
- refinements, structuring, and so forth, will be discussed later. -
- So, first, put all the MapView-related files into one subdirectory for
- now (you may omit the PAS and TPU files); put all the MP1 files you
- must have received independently there, too. Start up MapView from
- the DOS prompt; after marvelling at the logo, hit "X", followed by
- "ECL" when prompted (always without the quotes, to be sure; case is
- insignificant, by the way). Don't be bothered by a message saying
- that some file E0.LST can't be found - MapView is just showing off its
- ability to find even things that are not there. Hopefully, you will
- now watch a map of Europe (continental outlines only) being drawn.
- (Later you will learn how to make drawing much faster.) Now type "W"
- - you will see a pair of crosshairs, which you can move with the
- cursor keys; the upper left corner of the screen will always tell you
- where you are. When you're tired of it, hit the <ENTER> key. Now
- type "X" again, then "EN". You will have a different kind of map now,
- and this time it will be Europe along with its islands, lakes, and
- political boundaries. When drawing has finished, type "Z" to zoom in;
- first use the cursor keys to designate the South-West corner, hit
- <ENTER>, then designate the North-East corner, hit <ENTER> again.
- Nothing will happen. But then, hit "E" to erase the screen, then "D"
- to redraw - now you'll get the part you picked. Hit "X" again, then
- "WORLD0". Now you'll get a view of the Earth as seen from outer
- space; this will take some time to do. When you're ready to proceed,
- hit "S": you have just created a picture file on disk. Experiment
- some more; get help with "?", display settings with "M",... and
- finally, hit "Q" to quit. You're not through, yet - at the DOS
- prompt, type "SLIDE SCREEN /R0". In an instant, the world map will
- pop up on the screen. If you have typed "S" more often during your
- first session, all the pictures you saved will be shown in an endless
- slide show. Hit any key to finish. (You might also try the same with
- QSlide, if you have a CGA or a Hercules.) You're done for now!
-
-
- (ii) Setup
- ----------
-
- You will need at least MAPVIEW.EXE and a couple of map files (with
- extensions .MP3, .MP2, .MP0, or .MP1, see (vii) below); also, you will
- need the Borland BGI driver applicable to your display adapter. If
- you want the simple on-line help screen to be available, you need
- MAPVIEW.HLP. In addition, you may want to have MAPVIEW.CNF (a
- configuration file in plain text format, see (v) below), SLIDE.EXE
- and/or QSLIDE.EXE to view previously generated pictures as a 'slide
- show', and a variety of list files (extension .LST) and command files
- (extension .CMD). For the generation of .MP2 or .MP0 files, you will
- also need MP1TOMPX.EXE. TRIGCALC.EXE will prepare a file with
- precomputed trigonometric values for fastest execution; this is
- especially useful with MP0 or MP1 files but also speeds up use of MP2
- and MP3 files somewhat.
-
- I suggest you create a directory WORLDMAP to hold the executables, a
- subdirectory each for the command and list files (and possibly one for
- the picture files you will generate), and group the map files into
- subdirectories according to continents, say, EUROPE, AUSTRALI, and so
- forth. This is for your convenience only, though; MapView doesn't
- make any assumptions on your directory structure except that
- MAPVIEW.CNF, if present, MAPVIEW.HLP, and the BGI driver be in the
- current directory (or accessible via APPEND or the like). If you
- create subdirectories, you should set up MAPVIEW.CNF to reflect your
- choices; you can set a few other esoteric things in this file, too
- (see (v) below). If you want to pre-process the map files either to
- save disk space or to make execution much faster - which I recommend
- -, put all the map files into one directory, then use Mp1ToMpx (see
- (vii) below); move the resulting MP0, MP2 or MP3 files into the
- appropriate subdirectories, finally deleting the raw MP1 files. (You
- do have a back-up copy, don't you?). Finally, run TrigCalc if you
- have some 108KB to spare; see the note on timings (appendix C below)
- to decide if the speed gain is worth the disk space expenditure. -
- Now you may remove MP1TOMPX.EXE and TRIGCALC.EXE.
-
- Nearly all of this can be automated by using the two batch files
- supplied, INSTMVU.BAT and INSTMAP.BAT, which will set up everything
- for use with the configuration file provided. Copy all the MapView
- files and all the map files into a directory of your choosing, say
- WORLDMAP. Then type "INSTMVU": this will create several
- subdirectories for use by MapView and move the appropriate files to
- their places. Then type "INSTMAP 2" (or "INSTMAP 3" if you have an
- 80x87 coprocessor and are willing to recompile MapView): this will
- preprocess all the map files for fastest MapView operation and place
- them in subdirectories of their own. Alternatively, type "INSTMAP 0"
- if your disk space is scarce, or "INSTMAP 1", which will not
- preprocess files but just move them into the various subdirectories.
- - Note: before you start InstMap, make sure you have backup copies of
- the map data files as you received them - InstMap will delete these
- files after preprocessing them! - InstMap will take some time to run
- (about 45 minutes on my 10MHz AT clone if used with the "2" option;
- much less with the "0" option, and nearly no time with the "1"
- option).
-
-
- (iii) MapView operation
- -----------------------
-
- Start MapView by typing 'MAPVIEW' at the DOS prompt. It will display
- its default start-up screen and show a prompt in the upper row of the
- graphics screen. If ever you forget what the cryptic letters up there
- mean, type "?" to get on-line help. Now for the commands at your
- command, in an order that can get you started:
-
- L - set file List
-
- MapView will prompt you for the name of a file that contains the names
- of map files. The purpose of this is to allow you to group files
- together in a meaningful way, like, say E0, E1, and E2 to get Europe's
- outlines, its islands, and its lakes, but not its political
- boundaries. As an option, a list file may specify a colour for each
- map which then overrides any colour given by the "C" command (see
- below). The "L" command will not draw anything - that is done by the
- "D" command. List files have, by default, an extension of .LST; you
- may override this, though, by explicitly providing one. You can
- display a list of all available list files by replying "?" to the file
- name prompt. - As a special case, if you want to view a single map
- file, you may also specify this file's name here; if MapView can't
- find a list file with the name you give, it will try to find a map
- file with this name. - See (iv) below on how to prepare list files;
- you'll also find some intimation on why, probably, the LEV0 through
- LEV3 files are all you'll ever be going to need.
-
- D - Display a map
-
- Once you have specified a list file, you may draw the map files given
- there by this command. It uses all the parameters you have set so far
- (or the default ones). The screen is not erased initially (use the
- 'E' command for this); this allows you to overlay several maps, or
- maybe draw the same map with various projection methods on top of each
- other, to study the differences. MapView tells you with a beep when
- drawing is finished - it may take some time... If you get tired in
- the meantime, pressing a single key will suspend drawing; pressing "Q"
- or "ESCape" will return you to the main MapView prompt. (MapView will
- maybe not answer your request immediately, but it will eventually.)
- If you have set a small window and have specified files that have many
- coordinates outside your window, nothing will seem to happen for a
- long time; be patient. To keep you happy, there will be a small sign
- of progress in the lower right corner of the screen (unless you have
- toggled of the prompt line).
-
- P - set Projection method
-
- Since the Earth is a sphere (well, approximately) and your screen is
- part of a plane (well, approximately, again), MapView will have to map
- the surface coordinates into the plane. There is a choice of four
- different projections built into MapView:
-
- None (a misnomer, kept for historical reasons) simply treats the
- latitude and longitude as the y and x coordinates, respectively.
- Mercator uses a non-linear scaling which preserves angles; it is best
- near to the equator but distorts heavily as you approach the poles.
- Azimuthal here stands for an area-preserving azimuthal map, centered
- on one of the poles. This is a good one for regions way North or
- South. MapView chooses the pole that is best for the map window
- you have set (see "Z" below).
- Orthogonal projection displays the Earth as seen from outer space, and
- is particularly good for animated slide shows.
- Lambert uses a conformal conical mapping, i.e., angles are preserved
- locally. It is one of the better methods for smaller regions in
- medium latitudes.
-
- Of course, there are projection methods galore - maybe I'll add some
- more one day. Or maybe I won't.
-
- The latter two methods require you to specify a 'midpoint'; for the
- orthogonal projection, this specifies your eye-point, and for the
- Lambert projection, the latitude given is the one at which lengths are
- preserved, and the longitude implicitly defines the orientation of the
- map. The midpoint should, in general, be close to the center of the
- window you choose (see the "Z" command). You may enter these values
- either in decimal degrees or in dd:mm:ss form. - After startup,
- MapView uses Mercator projection by default.
-
- Z - Zoom, or: set map window
-
- If you want to view only part of the world, you may specify the
- South-West and the North-East right corners of the window you are
- interested in. You may give the coordinates explicitly (in decimal
- degrees or in dd:mm:ss form) in response to the prompt, ending each
- number by hitting "ENTER". Southern latitudes and Western longitudes
- are indicated by specifying a negative number. Alternatively, if you
- want to zoom in, you may use a cursor key to activate the crosshairs
- and choose the window graphically. Movement is pixel-wise by pressing
- one of the four arrow keys, or 10-pixel-wise by pressing "SHIFT" plus
- one of the numeric keypad arrow keys (assuming NumLock is off; on some
- keyboards, you may also use the "CTRL" key instead of "SHIFT"). Hit
- "ENTER" when you have picked the lower left corner, then pick the
- upper right corner in the same fashion. This will not yield the
- desired results if the region indicated crosses the international date
- line; sorry about that.
-
- Zooming will affect future "D" commands only, not the current screen.
- - Note that some projection methods will internally restrict the area
- displayed, according to the characteristics of each method.
-
- G - set Grid
-
- By default, MapView draws a grid in 20° intervals on every map. The
- grid width can be changed by the "G" command for latitude and
- longitude independently. Specifying no number toggles grid display on
- or off.
-
- W - Where are we now
-
- This command displays crosshairs, which can be moved with the arrow
- keys (or with "SHIFT" plus arrow keys for coarse movement); the
- coordinates corresponding to the current crosshairs location are
- displayed in the upper left corner. Hit "ENTER" to return to the main
- prompt when done.
-
- E - Erase screen
-
- MapView never erases the screen by itself - you have to tell it to do
- so.
-
- S - Save screen to file
-
- The screen is copied to the file you have previously specified with
- the "N" command (see below), or to the default file of SCREEN.PIC.
- Pictures are always appended at the end of the file.
-
- N - set Name of screen save file
-
- When you type "N", you will be prompted for the name of a file to save
- screens to. If you omit the extension, the default extension ".PIC"
- will be added. If you specify no drive or path, the default directory
- from your configuration file, if any, will be used. (If you want to
- override that choice and save to the current directory, start the file
- name with ".\".) - MapView will check if the file already exists; if
- so, it will append your saves to the end of the file. If not, a new
- file is created. - For an existing file, MapView checks whether it
- has a valid pic file format for the graphics adapter you are using. -
- The default name for screen save files is SCREEN.PIC.
-
- H - Hardcopy of screen to printer
-
- The current graphics screen is copied to the printer via one of the
- printer ports. This assumes the printer to be similar to an Epson FX,
- which many printers in fact are; if yours is not, you're out of luck,
- unless you adapt the source code (or persuade me to do so). - The
- default port used is 1 (i.e., LPT1); this can be changed in the
- configuration file (cf. (v) below).
-
- C - set Colour
-
- Future drawing will use the colour given by this number, except for
- those files that have a colour associated with them in the current
- list file (see (iv) below). What colour this in fact means depends on
- your graphics card and settings. You cannot specify a colour invalid
- for your graphics adapter; you can specify 0 (meaning black), though.
- See for yourself.
-
- A - toggle Adaptive scaling
-
- With projection methods None and Mercator, having adaptive scaling on
- means that, whenever you zoom or specify a window, the coordinates are
- expanded in such a way that the whole screen will be used. E.g., if
- you specify a window that is very narrow (in the East-West direction)
- but tall (in the North-South direction), then with adaptive scaling
- off you will have most of the screen black; but with adaptive scaling
- on, the East and West window limits are moved so that the entire
- screen is filled by the map. This affects future "D" commands only.
- It has no effect for orthographic and Lambert projection modes.
- Adaptive scaling is off by default.
-
- M - display Status
-
- All the relevant settings can be viewed with this command. Use this
- to determine your current window and projection method, or if you have
- forgotten what list file you specified, and so on.
-
- <blank> - erase prompt
-
- Hitting the space bar toggles the prompt display on or off; use this
- if you want to view a map unperturbed. While drawing, saving or
- printing, the prompt line is always off.
-
- X - eXecute a command file
-
- If you perform a sequence of commands often, you may want to automate
- this task - this is where command files come in. Simply use a text
- editor to create a file which contains MapView commands and tell
- MapView to execute these commands by typing "X" at the main prompt and
- then giving the command file's name. The default extension is .CMD;
- you may override this default by explixitly stating an extension. As
- with the "L" command, you may display a directory of command files by
- answering the file name prompt with "?". The bell signal that ends
- the processing of list files is inactive while a command file is being
- executed; nice if you don't want to be disturbed while MapView is
- churning away. For a different use of command files, see below. - See
- (iv) below on how to prepare command files.
-
-
- ? - get on-line help
-
- A short command line summary will be displayed. In case you're still
- confused: "If all else fails, read the documentation." (Quotation
- courtesy of Volker A.Brandt)
-
-
- Q - Quit
-
- Well, you've been waiting for that, haven't you.
-
-
- MapView may be run fully automatic - e.g., from a batch file - by
- supplying the name of a command file on the DOS command line, much as
- you would via the "X" command (but don't specify the "X" on the
- command line). Just remember to put a "Q" command in at the end of
- the command file; otherwise MapView will execute the file given and
- then wait for you to continue. This feature can also come in handy to
- override MapView's built-in defaults; if you prefer, say, to start
- with a clear screen and in orthographic projection mode, create a
- file (let's make it STARTUP.CMD) that contains the lines
- e
- p o 0 0
- and start MapView through 'MAPVIEW STARTUP'.
-
-
- (iv) Preparing list and command files
- -------------------------------------
-
- List files contain the names of map files, one per line. Path
- specifications may be included, but don't have to, if MapView can find
- the map files in the current directory or in one specified in the
- configuration file (see (v) below). In general, no extensions should
- be given; that way, MapView will use MP3, MP2, MP0, or MP1 map files,
- whichever it can find; see (vii) below. A special command, 'END', may
- be used to finish execution of a list file before its physical end.
- In addition, a colour number may be specified after each file name; if
- there is one, this colour will override any specified by the "C"
- command at run-time. (See your system's manuals to find out which
- number means which colour.) Anything following that number is treated
- as a comment and is ignored. Lines starting with a ';' are treated as
- comment lines.
-
- Command files contain one command per line, complete with all
- parameters (separated by blanks), and may contain any command you
- could give by hand; though it doesn't make much sense to give a "W"
- command here. If you want to include comments in a command file, the
- simplest way to do so is to write them on a line of their own that
- starts with a ';'. And, yes, you may nest command files, but MapView
- won't keep you from shooting yourself in the foot; so you'd better not
- try recursion, or nesting too deeply.
-
- Both list and command files are text files, as are configuration files
- (see (v) below).
-
- One word on text files - this also applies to command and list files:
- these files must be plain ASCII and should contain no embedded control
- sequences or tabs. Most programme editors are capable of producing
- such files, though not every word processor necessarily does. I'm
- following a time-honoured practice in advising you to specify
- non-document mode when using WordStar.
-
-
- (v) The configuration file
- --------------------------
-
- If you have a hierarchical file structure, you will have to tell
- MapView where to find its map, list, and command files. Also, a few
- other parameters that may be set for MapView can be specified here;
- these things will be used only for special hardware configurations or
- for particular needs; so, in general, they don't need to be specified
- at all, and if they do, they won't have to (and, consequently, can't)
- be changed during execution. To do so, prepare a file MAPVIEW.CNF
- that contains these data and put it into the current directory. This
- file should contain one information per line: first a keyword that
- tells MapView what kind of datum this is, then the value for this
- parameter, separated by one or more blanks.
-
- The first group contains the names of directories to be used. The
- keywords for this are:
-
- LST : where to find list files;
- CMD : where to find command files;
- MPX : where to find map files;
- PIC : where to store picture files.
-
- Place the name of the appropriate directory (fully specified) after
- the keyword, separated by a blank. Note that only one directory may
- be specified per line; in addition, there may be only one line each of
- type LST, CMD, and PIC. There may be many MPX lines, though - up to
- 15, to be exact.
-
- The second group is mainly concerned with peculiarities of your
- graphics equipment and your colouring preferences; the keywords are:
-
- MOD : set graphics mode;
- ASP : correct aspect ratio;
- GRC : set grid colour;
- BRC : set border colour;
- BGC : set background colour.
- PAL : set one colour in the palette used;
- PRN : number of printer port;
- OVP : number of overprintings for hardcopies.
-
- This stands in need of some clarification. To start with, your
- graphics adapter may support various graphics modes: Hercules
- doesn't, but, e.g., EGA does. MapView always chooses the highest
- resolution by itself; if you don't like that, you can change it here
- by including a line starting with 'MOD', then the number of a graphics
- mode to your liking. Try it out - you can't break anything. - ASP is
- the only parameter that accepts a real argument; if a full globe comes
- out distorted on your screen, you can correct this by giving an
- adjustment factor here which sizes in horizontal direction will be
- multiplied by.
-
- GRC, BRC, and BGC choose colours out of the current colour palette for
- their respective purposes; this won't help you with monochrome
- adapters, but otherwise, experiment to find out what you like best.
- Two special features are involved: a colour of 99 will always be the
- highest colour available, i.e., in general, white; negative values
- (for grid and border only) will draw those lines as dotted ones. This
- is mainly useful on monochrome boards to distinguish grid lines from
- serious stuff; so that's the default. Otherwise, this feature is not
- much good on monochrome adapters or screens. - Again, invalid
- arguments will be ignored. - PAL allows you to change colours in a
- palette on adapters that support this feature. You'll have to give
- two integer values on a PAL line: the first is the number of the slot
- within the palette, the second is the number of the colour. For
- details, refer to your graphics adapter's or computer's manual.
-
- Now for the printer support: usually, MapView uses printer port 1 for
- hardcopies. If you have connected your printer through a different
- port, you may specify that number on a PRN line. The range supported
- is 1 through 4. Finally, OVP allows you to select the number of times
- the print head moves over each line of graphics output when
- hardcopying. Overprinting makes the lines look blacker; but, of
- course, it takes some time. The number may be in the range from 1 to
- 5; the default is 1, which will suffice in many cases; 2 should
- definitely be enough. Of course, all this makes only sense for real
- matrix printers.
-
- Again, lines starting with a ';' are treated as comment lines.
-
-
- (vi) Slide and QSlide operation
- -------------------------------
-
- Once you have created a picture file, you may want to review it later;
- after all, that's presumably why you made it. For this purpose, Slide
- and QSlide are provided. They are very simple, non-interactive
- programmes that read a picture file and display the pictures in it
- sequentially. At start-up, you may tell them to introduce a delay of
- so-and-so-many milliseconds between each two pictures, and to repeat
- the whole sequence so-and-so-often, where 'so-and-so-...' is between 0
- and 65535. A repeat count of 0 will repeat indefinitely; a delay time
- of 0 will give a special maximum delay of some 11 minutes. You may
- abort operation at any time by pressing any key.
-
- There is an additional optional switch, the keypress switch: if you
- specify "/K" on the command line, pressing a key will not in general
- quit the programmes but rather immediately switch to the next picture.
- This is handy for semi-automated slide shows: call Slide (or QSlide)
- with a delay of, say, 10000 milliseconds (or maybe even choose the
- extra long delay time as explained above), and hit any key as soon as
- you are fed up with one particular picture. The keys "Q", "ESC" and
- "Ctrl-C" may still be used to quit the programme, however.
-
- The first time through, Slide will try to read all the pictures into
- memory and display them from there later on, when you have specified a
- repeat count greater than 1. If they don't fit, Slide will continue to
- read pictures from disk repeatedly. If you have a graphics adapter
- with at least two pages, it will do very smooth swapping. If, or as
- long as, it has to read from disk, the display rate is about 2
- pictures per second; if it takes them from memory, the rate is about 3
- per second. (These times are for a 10MHz AT and a 28ms hard disk.)
- On a 640k PC with no memory hogs installed, about 17 Hercules screens
- can be held in memory; this figure will be much less for EGA or VGA
- screens, of course. If you have one of these adapters, you may want to
- use some form of CGA or Hercules emulation for slide shows.
-
- If all the pictures in a file fit into memory at once, you may want to
- use QSlide instead of Slide. Picture swapping is not so smooth while
- reading from disk; but once that is done, QSlide will be rocket-fast:
- you'll get more than 15 screens per second (on a 10MHz AT). This will
- only work on CGA or Hercules adapters due to size limitations; sorry
- for this - blame the 80x86 segment structure. - Due to the different
- screen storage management, there may be slightly less room for
- pictures; e.g., with 580KB free memory, I can fit 17 Hercules screens
- into Slide, but only 16 into QSlide. Have a try.
-
- There are two example command files for MapView, GRID16.CMD and
- WORLD16.CMD, which produce files for use with Slide and QSlide; these
- are designed with the Hercules user in mind. You can take these as a
- starting point to making your own.
-
- Both programmes check if the picture file was produced for the display
- adapter you are using; if not, they tell you so and quit.
-
- Call Slide from the DOS command line via
- slide <filename> [/R<repeatcount>] [/D<delay>] [/K]
- or QSlide via
- qslide <filename> [/R<repeatcount>] [/D<delay>] [/K]
-
- (with no blanks except where indicated). The default extension is
- .PIC. Note that both programmes will not search any paths by
- themselves; so if you have made up a separate picture directory, be
- sure to include its name with the file name.
-
-
- (vii) Map files
- ---------------
-
- MapView is made around the world map files provided by Mr John
- Allison, The World Digitized, Apollo, PA. These files are not part of
- the MapView package but may be obtained at various bulletin boards and
- shareware servers. Please, heed his request for a $20 donation. He
- has also supplied good documentation of the data and discusses
- strengths and weaknesses.
-
- MapView can read three different file formats. The basic format is
- the MP1 format, as supplied by Mr Allison; these files are plain
- ASCII. From these files, MP2 and MP3 files are derived, which store
- latitude, longitude, Mercator equivalent of latitude, and precomputed
- three-dimensional Cartesian coordinates in binary format; MP2 is
- mainly for non-80x87 machines, whereas MP3 is designed to take
- advantage of a math-coprocessor and is also slightly more compact (cf.
- appendix C below). Both these formats allow for fastest MapView
- execution but takes up even more space on your disk. Alternatively,
- you may use MP0 files, which are binary integer values; these are the
- most compact format, still somewhat faster to process than MP1 files,
- but by far slower than MP2 and MP3 files. Also, there is a slight
- decrease in exactness; unless you zoom way down, this should not
- result in inaccuracies of more than one pixel.
-
- There is another advantage to using MP2, MP3 or MP0 files: these
- include quick-scan information on which region of the Earth they
- pertain to. What good is this? Well, suppose you have only MP1
- files, and suppose further you have displayed a map of the whole
- world, and now zoom down to some comparatively small region, say
- Australia. If you forget to switch to an appropriate list file (e.g.,
- AU2), MapView will try to display each of the world map files: no
- harm done, but you will be kept waiting for a long time while MapView
- tries to plot all those lines outside of Australia. With MP0, MP2, or
- MP3 files, however, MapView can quickly determine if a certain map
- file should be considered for plotting at all, and you'll be done in
- almost the same time as if you had specified the correct subset of
- maps. (In fact, this feature practically removes the need for most of
- the list files, except LEV0 through LEV3 - whichever region you choose
- to display, just select one of the LEV files according to the amount
- of information you want.) Of course, you don't have to have more than
- one format on disk; pick your choice - space or speed.
-
- For drawing, if you haven't specified an extension for a file to draw
- (usually in the list file you are plotting), MapView will try to find
- a map file with extension .MP2 (in the current directory or any of the
- subdirectories specified on an MPX line in your configuration file);
- if you have recompiled MapView to make use of a coprocessor, MapView
- will look for extension .MP3 instead. If it finds none, it will try a
- MP0 file, and, as a last resort, a MP1 file.
-
- To produce MP2, MP3, or MP0 files from an MP file, you can call
- Mp1ToMpX from the DOS prompt via
-
- MP1TOMPX <filename> [/0 | /2 | /3]
-
- where the file name must include its extension MP1. The file must be
- in the current directory or include a path, and the resulting file is
- written to the current directory. - Alternatively, if you want to
- process a group of files, prepare a text file containing the fully
- qualified file names (no extension) of all the files in the group; the
- extension must be LST. In fact, you can use such a file later on as a
- list file; or you can use the list files distributed with this
- package. Then call Mp1ToMpX from the DOS prompt via
-
- MP1TOMPX <listfilename> [/0 | /2 | /3]
-
- Again, the file name must include its extension LST, and a path may be
- specified.
-
- /0 will produce MP0 files, /2 will produce MP2 files, etc.; /2 is the
- default. - Note that MP1TOMPX expects all MP1 files in the current
- directory, unless specified otherwise. - Hence, to convert to MP2
- format the whole bunch of MP1 files as supplied by Mr Allison, group
- them all together in a single directory; put the file LEV3.LST there,
- too, and type
-
- MP1TOMPX LEV3.LST
-
- This process will take about 45 minutes on a 10MHz AT with a 28ms hard
- disk, time well spent. Producing MP0 files is much faster, of course.
- - Note that you need not concern yourself with the details of all this
- if you use INSTMAP.BAT included with the MapView package (see (ii)
- above).
-
- One more note: the binary formats are not very archive-friendly,
- i.e., they don't compress well under the common compression
- algorithms, while MP1 files do. If you want to store away
- full-precision data for later whatever-you-like-to-do-to-data, you'd
- better use the original MP1 files; they take up much less space (after
- compression) than MP2 files, and you don't give away precision as you
- would with MP0 data, which, after compression, are still smaller than
- the compressed MP1 data.
-
-
- (viii) Trigonometric values file
- --------------------------------
-
- For fastest MapView execution, you may produce a file that holds
- precomputed trigonometric values as used by MapView. If MapView finds
- this file in the current directory at start-up and you have enough
- free memory, it will read this file and execute faster (at the expense
- of a slight loss of accuracy - but that should not result in errors of
- more than one pixel, except at very high magnifications); if it does
- not find the file, that's fine with MapView, too. In general, the
- file produced will be called TRIG2.BIN, which is designed for use with
- MapView as distributed. If, however, you decide to recompile MapView
- for use with an 80x87, specify "/3" as a command line parameter for
- TrigCalc. This will produce a file called TRIG3.BIN. - You will
- notice the speed gain particularly if you use MP0 or MP1 files; see
- the timings in appendix C below.
-
- To make the file, just run TRIGCALC.EXE - that's it. You won't need
- the EXE file any more, so you may remove it from your hard disk.
- (Remember to say "TRIGCALC /3" instead if you have recompiled MapView
- for 80x87 use.)
-
-
- (xi) History
- ------------
-
- Version 1.0 Original programme by Ton van den Bogert
- <WWDONIC@HEITUE5.BITNET>, written in TurboPascal 3.01 for
- Hercules graphics adapter.
-
- 2.0 Converted to TurboPascal 5.0 by Gisbert W.Selke
- <RECK@DBNUAMA1.BITNET>. Removed (hopefully) all Hercules
- specifics. Now handling orthographic projection properly
- in all cases. Added Lambert projection. Re-arranged code.
- Added bells and whistles. Changed command interface
- slightly. Added support for MP0, MP1 and MP3 file formats.
- Added configurability. Generalized picture file format.
- Added compiler switches for easy recompilation on 80x87
- systems. Supplied new picture file viewers and file
- preprocessors. See separate upgrade notice if you have
- old command files. - Released 12 Jan 1989.
-
-
- (x) Bugs, limitations, future enhancements
- ------------------------------------------
-
- If a map extends beyond the window specified, the connections between
- points just barely within the window and their outside neighbours are
- not displayed. I don't think this is a serious limitation.
-
- Support for other types of printers may become available.
-
- More projection methods may be added.
-
- I haven't tested the colour features, nor have I tested either MapView
- or Slide on anything but a Hercules graphics adapter. This includes
- Slide and QSlide. I hope all works as advertised.
-
- MapView currently does not allow small areas on the 'back side of the
- Earth' to be viewed, e.g., from 170° West to 170° East. Some day I'll
- add this 'wrap-around' feature.
-
- MapView will not run on very small systems; it is designed for speed
- (I/O buffering and the ilk), not for memory size. But then again, who
- has a 128k machine.
-
-
- Bugs? I'd like to hear about them. Get in touch with me at
-
- TapirSoft
- Gisbert W.Selke <RECK@DBNUAMA1.BITNET>
- Ermekeilstrasse 28
- D-5300 Bonn 1
- West Germany
-
-
-
-
- Appendix A
- ----------
-
- This appendix briefly describes the file formats used by MapView.
-
- MP0 files
-
- These files essentially contain longitude and latitude of map points.
- Both values have to be multiplied by 0.01 to yield true degrees. In
- addition, if the resulting latitude is greater than 100, 200 has to be
- subtracted from it. If so, this indicates that the current point
- starts a new chain of points; otherwise (i.e., without having to
- subtract), the current point is connected to the previous point by an
- approximate straight line (or circle, to be exact). Each record takes
- up 4 bytes. The first two records are special: instead of belonging
- to the map data proper, they list the minimum and maximum latitude and
- longitude present in this file. The Pascal record that describes
- these data is (where an integer takes up 2 bytes)
-
- Type mp0rec = Record
- ilon, ilat : integer;
- End;
-
-
- MP1 files
-
- These are the original data as supplied by Mr Allison. They contain
- real type latitude and longitude in plain ASCII format; anything after
- the second real is junk and should be disregarded. An empty line in
- the file indicates that the next point is unconnected to the preceding
- one. Note that the order of latitude and longitude is reversed with
- respect to MP0 (and MP2) files.
-
-
- MP2 files
-
- These files contain pre-processed real data in binary format. These
- real values are 6-byte reals as required by ordinary (i.e.,
- non-coprocessor) TurboPascal. The first byte is a flag which, when 0,
- indicates that the current point is connected to the previous one;
- otherwise, this point starts a new outline. Then come the longitude
- and the latitude, the Mercator equivalent of the latitude, and the
- three-dimensional Cartesian x, y, z coordinates of the point, scaled
- to be on the surface of the standard unity sphere. Each record takes
- up 37 bytes. The first record in the file is special: its record
- type is FFh, and it lists the minimum longitude, minimum latitude,
- maximum longitude, maximum latitude present in this file. The rest of
- this record is 0. The Pascal record that describes these data is
-
- Type mp2rec = Record
- rectyp : byte;
- lon, lat : real;
- merclat : real;
- xg, yg, zg : real;
- End;
-
-
- MP3 files
-
- This format is nearly identical to the preceding one, except that it
- uses 4 byte reals (IEEE single precision reals) instead of
- TurboPascal's 'native' 6 byte reals. See appendix B below on
- recompilation to make use of this format. - The only things different
- are: each record takes up 25 bytes, the header record's record type
- is FEh, and the appropriate Pascal record is
-
- Type mp3rec = Record
- rectyp : byte;
- lon, lat : single;
- merclat : single;
- xg, yg, zg : single;
- End;
-
-
- Picture files
-
- Pictures are stored on disk in a simple, uncompressed way, using
- variable length records. For each picture, there is a lead-in record
- of fixed length (12 bytes) that contains information on the file
- format version, the number of pictures to follow to create a single
- screenfull (see below), the graphics driver and mode used, the size
- (in bytes) of the picture being described, and its upper left corner.
- The next record contains the image as supplied by the TurboPascal 4.0
- GetImage procedure, i.e., twice 2 bytes size information, then the
- actual bit map. Then comes the next picture's lead-in record. - See
- MAPGRAPH.PAS for a way to write pictures in this format (procedure
- SAVE), or SLIDE.PAS for a way how to read them. The Pascal record
- that describes the lead-in record is
-
- Type picdesc = Record
- version, follow : byte;
- grdriver, grmode : integer;
- size : word;
- xmin, ymin : integer;
- End;
-
- To read the image data, take an untyped pointer variable, allocate
- memory as indicated by the size information, and read the next record
- into the memory region thus set aside.
-
- The value of FOLLOW is usually 0; however, the size of an EGA or VGA
- screen exceeds the buffer size that can be allocated by TurboPascal.
- Hence, these pictures are stored in chunks. Each chunk is written to
- the file like a complete picture, header record and all; each header
- record's FOLLOW byte gives the number of chunks that will follow the
- current one, and it is 0 on the last chunk of a screen. XMIN and YMIN
- specify the region of the screen where each chunk belongs.
-
-
- Configuration, command, and list files
-
- These files are plain ASCII files created with any editor capable of
- not writing special control sequences to the file. Any reasonable
- editor should be able to do so; however, some word processors may not.
- (You might just as well cast those into the binary garbage bin, or
- /DEV/NUL, if you're a Un*x type.) If need be, use the DOS COPY
- command. Or, horribile dictu, EDLIN. - For particulars, see the
- sections above explaining what these files should contain, and why. -
- There remains one file: MAPVIEW.HLP. This file contains the screen
- (or screens) you get when you type "?" at the main MapView prompt.
- You can tailor it to your own needs, or translate it into Gaelic, or
- even German, if you like.
-
-
- Appendix B
- ----------
-
- A note on recompilation and coprocessor support
-
- Since 80x87 math coprocessors are not in general use, MapView, as
- distributed, is designed to run on non-coprocessor systems.
- Everything has been set up so that recompilation on an 80x87 machine
- will automatically produce a MapView version optimized for the
- additional hardware; there is no need to change the source. Note that
- the coprocessor version cannot read MP2 files (nor TRIG2.BIN); use the
- "/3" switch for Mp1ToMpX and TrigCalc to produce the appropriate
- formats. These latter programmes don't have to be recompiled since
- they emulate a coprocessor, which is acceptable since they need to be
- run only once. - If, for some reason, you do not have a coprocessor
- but want to pretend, you'll have to change the sources of MAPVIEW.PAS,
- MAPPROJ.PAS, and MAPGRAPH.PAS in one place each: replace the "N-"
- compiler directives by "N+,E+".
-
- Recompilation under TurboPascal 4.0 is also possible; MapView makes no
- use of new features except the compiler switch "A+", which may be
- removed without harm. The utility programmes Mp1ToMPX and TrigCalc
- make use of the compiler switch "E+", too; this can be removed on
- 80x87 systems only. Otherwise, all references to the variable types
- SINGLE and EXTENDED have to be removed, too.
-
-
-
- Appendix C
- ----------
-
- MapView Timings
-
- This appendix shows you what to expect in performance. All the times
- given have been taken on an AT clone running at 10MHz, equipped with a
- 28ms hard disk, and no coprocessor. FastOpen had been installed.
- (These times are one-time measurements, not the results of carefully
- devised series of experiment.)
-
- To plot the outlines of continental Europe, E0, without showing grids,
- window set to 35°/-10° .. 75°/40°, the times (in seconds) were
-
- File format used
- -- with TRIG2.BIN -- -- without TRIG2.BIN --
- Projection type MP0 MP1 MP2 MP0 MP1 MP2
- None 11 29 8 11 29 8
- Mercator 13 32 8 80 98 9
- Azimuthal 19 35 17 56 72 54
- Orthographic 38 58 26 123 141 34
- Lambert 38 58 34 128 147 62
-
-
- Using a coprocessor will speed things up considerably, especially if
- MapView has been recompiled and MP3 files (and TRIG3.BIN) are used;
- using TurboPascal 5.0 coprocessor emulation will slow operation down,
- of course.
-
- Processing the command file WORLD72, i.e., 72 pictures of the Earth in
- orthographic projection, viewed from various angles, with coastlines,
- islands, and lakes (but no political boundaries), and saving all 72
- images to disk, took six and a half hours. A complete set of MP2
- files had been generated before; otherwise...
-
- As for conversion and Slide timings, see the appropriate sections
- above.
-
-
- Appendix D
- ----------
-
- General Nonsense and Assorted Rubbish
-
- Special thanks go to Ton van den Bogert for the first version of this
- programme, and to Ken van Camp <kvancamp@ARDEC.ARPA> for the precursor
- of MP0 files, and his original Swivel programme, which got me started;
- they both did extensive testing of this release and supplied me with
- many valuable hints and suggestions for improvements; also to Stefan
- Kaufmann <UNM407@DBNUAMA1.BITNET> and Rainer Kleinrensing <RAINER
- @DBNUAMA1.BITNET>, for important hints and beta-testing; Stefan also
- improved Slide and suggested to me the algorithm used in QSlide.
- Thanks, of course, to John Allison for all the map data. - Still, all
- mistakes are my own, as the saying goes; or blame your CPU.
-
- Now for the commercial.
-
- There is none. At least not from me. I only ask you to give credit
- where credit is due, and not to give away any of this stuff except as
- a whole. If you change anything, please, document it, and tell me
- about your improvements - I'm interested in them, too! The copyright
- on all this remains with Ton van den Bogert and with me, though; so
- you're not gonna sell any of this.
-
- But, on the other hand:
-
- We assume no liability, impress or explied, for this programme's being
- fit for any particular purpose; the risk is entirely the user's. You
- have been warned.
-
- To my best knowledge, no copyrighted material, except where indicated,
- is used in this programme; however, nothing should be taken for
- granted.
-
- The following registered trademarks /etc/ have been used:
-
- TurboPascal, BGI : Borland International
- IBM PC, AT : International Business Machines Corporation
- MS-DOS : MicroSoft Corporation
- Unix : AT&T
- Hercules : Hercules Corporation, or whatever they call themselves
- WordStar : MicroPro International Corporation
- Epson : Seiko Epson Corporation
-
-
- [ End of MAPVIEW.DOC ]
-